package symbolTable.seniorST;

import stackAndQueue.Queue;

public class TestBST {
    public static void main(String[] args) {
        BSTRecursion<String, Integer> bst = new BSTRecursion<>();
        bst.put("i", 9);
        bst.put("a", 1);
        bst.put("q", 17);
        bst.put("c", 3);
        bst.put("k", 11);
        bst.put("e", 5);
        bst.put("o", 15);
        bst.put("g", 7);
        bst.put("m", 13);

        System.out.println(bst.get("k"));
        System.out.println(bst.min());
        System.out.println(bst.max());
        System.out.println(bst.floor("h"));
        System.out.println(bst.ceiling("h"));
        System.out.println(bst.rank("h"));
        System.out.println(bst.select(bst.rank("h")));
//        System.out.println(bst.select(4));
        bst.show();
        bst.delete("e");
        bst.delete("h");
        Queue<String> keys1 = (Queue<String>) bst.keys();
        for (String key : keys1){
            System.out.print(key+" ");
        }
        System.out.println();
        Queue<String> keys = (Queue<String>) bst.keys("c", "n");
        for (String key : keys){
            System.out.print(key+" ");
        }
        System.out.println();
    }
}
